home *** CD-ROM | disk | FTP | other *** search
/ Pascal Super Library / Pascal Super Library (CW International)(1997).bin / MATH / NRPAS13 / RED.PAS < prev    next >
Pascal/Delphi Source File  |  1991-04-29  |  727b  |  25 lines

  1. PROCEDURE red(iz1,iz2,jz1,jz2,jm1,jm2,jmf,ic1,jc1,jcf,kc: integer;
  2.          c: glcarray; nci,ncj,nck: integer;
  3.          VAR s: glsarray; nsi,nsj: integer);
  4. (* Programs using routine RED must define the types
  5. TYPE
  6.    glcarray = ARRAY [1..nci,1..ncj,1..nck] OF real;
  7.    glsarray = ARRAY [1..nsi,1..nsj] OF real;
  8. in the main routine. *)
  9. VAR
  10.    loff,l,j,ic,i: integer;
  11.    vx: real;
  12. BEGIN
  13.    loff := jc1-jm1;
  14.    ic := ic1;
  15.    FOR j := jz1 TO jz2 DO BEGIN
  16.       FOR l := jm1 TO jm2 DO BEGIN
  17.          vx := c[ic,l+loff,kc];
  18.          FOR i := iz1 TO iz2 DO s[i,l] := s[i,l]-s[i,j]*vx
  19.       END;
  20.       vx := c[ic,jcf,kc];
  21.       FOR i := iz1 TO iz2 DO s[i,jmf] := s[i,jmf]-s[i,j]*vx;
  22.       ic := ic+1
  23.    END
  24. END;
  25.